#pragma once
#include <fcntl.h>
#include<cstdlib>
#define NON_BLOCK_ERR -2
void SetNoBlock(int fd)
{
 int fl=fcntl(fd,F_GETFL);
 if(fl<0)
 {
    exit(NON_BLOCK_ERR);
 }
 fcntl(fd,F_SETFL,fl|O_NONBLOCK);
}